home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
arovin1a
/
wander.bas
< prev
Wrap
BASIC Source File
|
1999-10-09
|
587b
|
31 lines
Attribute VB_Name = "Wander"
Option Explicit
Dim HorDir As Boolean
Dim VerDir As Boolean
Public Function Haunt(frm As Form)
If HorDir Then
frm.Left = frm.Left - 600
If frm.Left < 0 Then
HorDir = False
End If
End If
If HorDir = False Then
frm.Left = frm.Left + 600
If frm.Left > Screen.Width - frm.Width Then
HorDir = True
End If
End If
If VerDir Then
frm.Top = frm.Top - 600
If frm.Top < 0 Then
VerDir = False
End If
End If
If VerDir = False Then
frm.Top = frm.Top + 600
If frm.Top > Screen.Height - frm.Height Then
VerDir = True
End If
End If
End Function